Repository navigation
Conversation
When fn keeps only a few documents (a filter, a count), the threads no longer build a list entry for each of the others, and the calling thread no longer collects and frees them. Counting the stars of 7.6 GB of GH Archive events with fn returning the repository or None (90,403 results out of 2.2 million) on big4, 64 threads, 3.14.10t: 73.6 to 88.0 GB/s end to end, Counter included.
# Conflicts: # tests/test_stream.py
lemire
added a commit
that referenced
this pull request
Nov 14, 2026
- Streams read read-only memoryviews of bytes and of read-only mmaps in place (#13). - Parallel streams move their results into the list without reference counting (#14). - fields= reads the documents with On-Demand (#15). - map_many(..., drop_none=True) leaves out the results that are None (#16). - Wheels for Pyodide (WebAssembly), Python 3.13 to 3.15; fixes for targets without SSE2 or NEON (dumps with ensure_ascii=False on strings of 16 bytes or more) and for parse_many under Pyodide (#17).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on #14 (its first commit is #14's change; the diff against main includes it until #14 is merged).
map_many(fn, data, drop_none=True)leaves out the results offnthat areNone, in the worker threads and on the one-thread path. Whenfnkeeps only a few documents (a filter, a count), the threads no longer build a list entry for each of the others, and the calling thread no longer collects, walks and frees them.Counting the stars of 7.6 GB of GH Archive events (
fnreturns the repository of a WatchEvent, elseNone: 90,403 results out of 2.2 million), big4, 3.14.10t, with #13, #14 and #15, end to end including the caller'sCounter:Tests: with and without threads, with fields, only None dropped (other falsy results kept), exceptions from fn and the json fallback unchanged. Full suite passes on 3.14.10 and 3.14.10t.